<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of ShowForm
 *
 * @author lzx
 */
require_once BaseUtil::getModulePath('base').'/forms/BaseForm.php';
require_once BaseUtil::getModulePath('consult').'/constants/ConsultConstant.php';
class EditForm extends BaseForm{
    //put your code here
    public function __construct(){
        parent::__construct();
        $queryId = new Zend_Form_Element_Hidden("id");
        $queryReplyId = new Zend_Form_Element_Hidden("replyId");
        if(empty($queryReplyId)) {
            $this->setAction(HttpUtil::getUrl("consult", "subadd"));
        } else {
            $this->setAction(HttpUtil::getUrl("consult", "subedit"));
        }      
        //hidden to save current admin id
        $hReplayId = new Zend_Form_Element_Hidden("hReplayId");
        $user = BaseUtil::getLoginUser();
        $userid = $user['uid'];
        $hReplayId->setValue($userid);//current administrator id
        //content        
        $content = new Zend_Form_Element_Textarea('content');
        $content->setLabel($this->translate->_('replyContent')); 
        
        $content->setValue($this->translate->_('initContent'));   //set the content init value
        
        $content->setAttribs(array("rows"=>6,"cols"=>46));
        $content->addFilter("StringTrim");
        $content->setRequired(true);
        //edit to phtml
        $this->addElements(array($queryId,$queryReplyId,$content,$hReplayId));
        $this->setElementDecorators(array ('ViewHelper',array(array('div' =>'HtmlTag'),array('tag' =>'div',"class" => "form_element" )),));
    }

}
?>
